package creational.builder;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author binbin
 * @since 2022/10/6 4:00
 */
public class DefaultPhoneBuilder extends PhoneBuilder<Phone> {

    public DefaultPhoneBuilder() {
        phone = new Phone();
    }

    @Override
    public DefaultPhoneBuilder buildPhoneBrand(String brand) {
        phone.setBrand(brand);
        return this;
    }

    @Override
    public DefaultPhoneBuilder buildPhoneModel(String model) {
        phone.setModel(model);
        return this;
    }

    @Override
    public DefaultPhoneBuilder buildPhonePrice(double price) {
        phone.setPrice(price);
        return this;
    }

    @Override
    public DefaultPhoneBuilder buildPhoneRAM(double ram) {
        phone.setRam(ram);
        return this;
    }

    @Override
    public DefaultPhoneBuilder buildPhoneStorage(double storage) {
        phone.setStorage(storage);
        return this;
    }

    @Override
    public Phone build() {
        return phone;
    }

}
